package com.foreveross.vo;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.springframework.format.annotation.DateTimeFormat;

import com.foreveross.vo.common.AffiliatedBaseVo;

/**
 * HrCode entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "hr_code", catalog = "hrtenement")
public class HrCode extends AffiliatedBaseVo implements java.io.Serializable  {

	// Fields

	private String codeId;
	private String type;
	private String typeName;
	private String codeDesc;
	private Integer num;
	private SysUser creater;
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	private SysUser updater;
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date updateTime;
	private String status;
	
	private List<HrHouses> hrHouseList = new ArrayList<HrHouses>();

	// Constructors

	/** default constructor */
	public HrCode() {
	}
	
	public HrCode(String codeId) {
		this.codeId=codeId;
	}

	/** full constructor */
	public HrCode(String codeId, String type, String typeName,
			String codeDesc, Integer num, SysUser creater, Date createTime,
			SysUser updater, Date updateTime, String status) {
		this.codeId = codeId;
		this.type = type;
		this.typeName = typeName;
		this.codeDesc = codeDesc;
		this.num = num;
		this.creater = creater;
		this.createTime = createTime;
		this.updater = updater;
		this.updateTime = updateTime;
		this.status = status;
	}

	// Property accessors
	@Id
	@GenericGenerator(name="idGenerator", strategy="uuid")
	@GeneratedValue(generator="idGenerator") 
	@Column(name = "code_id", unique = true, nullable = false, length = 32)
	public String getCodeId() {
		return this.codeId;
	}

	public void setCodeId(String codeId) {
		this.codeId = codeId;
	}

	@Column(name = "type")
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "type_name")
	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@Column(name = "code_desc")
	public String getCodeDesc() {
		return this.codeDesc;
	}

	public void setCodeDesc(String codeDesc) {
		this.codeDesc = codeDesc;
	}

	@Column(name = "num")
	public Integer getNum() {
		return this.num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creater")
	@NotFound(action=NotFoundAction.IGNORE)
	public SysUser getCreater() {
		return this.creater;
	}

	public void setCreater(SysUser creater) {
		this.creater = creater;
	}

	@Column(name = "create_time")
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "updater")
	@NotFound(action=NotFoundAction.IGNORE)
	public SysUser getUpdater() {
		return this.updater;
	}

	public void setUpdater(SysUser updater) {
		this.updater = updater;
	}

	@Column(name = "update_time")
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "status")
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Transient
	public List<HrHouses> getHrHouseList() {
		return hrHouseList;
	}

	public void setHrHouseList(List<HrHouses> hrHouseList) {
		this.hrHouseList = hrHouseList;
	}
}